1. Field of the Invention
The present invention relates to information processing apparatuses and methods, and recording media and programs used therewith, and, in particular, to an information processing apparatus and method which generate encoded video data so that the recording capacity of a recording medium for the encoded video data can be efficiently used up, and which record the encoded video data in the recording medium, and to a recording medium and program used therewith.
2. Description of the Related Art
In authoring apparatuses used in sites where recording media, such as optical discs, are created, each of video data items and audio data items is encoded (compression-coded) by using an MPEG (Moving Picture Experts Group) technique. The authoring apparatuses combine the resultant encoded data items with one another, and record the resultant multistream in recording media.
An authoring apparatus of the above type allocates an amount of bits recordable in a recording medium to each item of data such as video data and audio data, and performs encoding on the item of data so that the data can be recorded within the allocated bit amount.
As a technique for encoding the video data in this case, a technique called “two-path encoding” is disclosed in, for example, Japanese Unexamined Patent Application Publication No. 11-004445.
An overview of “two-path encoding” is described below.
FIGS. 1 and 2 show concepts concerning the entirety of “two-path encoding” of the related art. Specifically, the “two-path encoding” is a technique including provisional (pre-) encoding and main encoding. The provisional encoding is hereinafter referred to as “first path encoding”, and the main encoding is hereinafter referred to as “second path encoding”. Of the above “two-path encoding”, the concept of the first path encoding is shown in FIG. 1, and the concept of the second path encoding is shown in FIG. 2.
As shown in FIG. 1, the first path encoding is executed by an encoder (fixed quantization unit) 1-1 and an external computer 2, and, as shown in FIG. 2, the second path encoding is executed by an encoder 1-2 and the external computer 2. However, actually, in many cases, the encoders 1-1 and 1-2 may be the same device.
At first, the encoder 1-1 in FIG. 1 performs the first path encoding on continuous video data, which is to be recorded on an optical disc (not shown), with predetermined encoding conditions maintained. In the first path encoding, the external computer 2 sequentially detects various types of data, for example, the amount of generated bits, obtained in the first path encoding by the encoder 1-1, in units of frames. In Japanese Unexamined Patent Application Publication No. 11-004445, not the amount of generated bits, itself, but intra AC or ME residual is detected by a functional unit corresponding to the external computer 2.
Next, based on the amount of generated bits detected in each frame, the external computer 2 allocates bits to the frames forming the video data. In other words, the external computer 2 sets, in units of frames, target amounts of bits for use in the second path encoding.
The external computer 2 also assigns picture types for use in the second path encoding.
Assigning the picture types represents assigning encoding types to the frames.
Specifically, in MPEG, by using one encoding type among an I picture (intra-picture), a P picture (predictive-picture), and a B picture (bidirectionally predictive-picture), data in each frame is encoded.
The I picture represents an encoding type in which image data for one frame is directly encoded without using image data in another frame. In other words, the I picture represents an encoding type of intraframe encoding.
The P picture and the B picture represent encoding types of interframe encoding. Specifically, the P picture basically represents an encoding type in which a difference (prediction error) between image data for one frame and image data in a predictive frame of the I or P picture, which temporally precedes the image data for one frame, is obtained and encoded. The B picture basically represents an encoding type in which a difference (prediction error) between image data for one frame and image data in a predictive frame of the I or P picture, which temporally precedes or follows the image data for one frame, is obtained and encoded.
Accordingly, assigning the picture types means assigning each frame to one of the three encoding types, that is, an I picture, a P picture, and a B picture. In other words, it may be said that assigning the picture types is to set up each GOP (group of pictures) structure.
As described above, after the first path encoding, its result is used to perform setting target amounts of bits and assigning picture types in units of frames.
Next, encoding conditions that include at least picture types and target amounts of bits for the frames are set, and second path encoding is executed in accordance with the encoding conditions.
As shown in FIG. 2, the encoder 1-2 performs the second path encoding on the same video data as shown in FIG. 1, and outputs the resultant encoded video data. Specifically, the encoder 1-2 sequentially encodes data items in frames forming the video data so that the data items have picture types assigned by the external computer 2 and target amounts of bits set by the external computer 2. As a result, a bit stream, formed such that encoded frame data items of one of I, B, and P pictures are consecutively located, is output as encoded video data from the encoder 1-2. At this time, the external computer 2 may update the target amounts of bits on the basis of the amounts of generated bits supplied from the encoder 1-2, if necessary.
The “two-path encoding” disclosed in Japanese Unexamined Patent Application Publication No. 11-004445 has been described as an example of a video data encoding technique of the related art.
In addition, other video-data encoding techniques of the related art are also disclosed in, for example, Japanese Unexamined Patent Application Publication No. 11-346365 and Japanese Patent Publication No. 3253971.
In the technique disclosed in Japanese Unexamined Patent Application Publication No. 11-346365, the following first processing to third processing are executed in the order given. Specifically, in the first processing, the first path encoding is performed for all intervals of video data. In the second processing, first path encoding is performed for only a particular interval of the video data. In the third processing, only data of a particular interval of the video data encoded by the first path encoding is replaced by video data encoded by the second path encoding, and the data obtained by the replacement is output as final encoded video data.
In the technique disclosed in Japanese Patent Publication No. 3253971, in the video data encoded by the first path encoding, the amount of bits to be assigned to an interval of the video data in which reduction of bits causes no problem is reduced. The target amount of bits is set so that the reduced amount of bits is assigned to another interval. In accordance with the target amount of bits, the second path encoding is performed.